<?php
/**
 * @package		Joomla.Site.Modules
 * @subpackage	mod_carousel
 * @copyright	Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
 * @license		GNU General Public License version 2 or later; see LICENSE.txt
 */

// no direct access
defined('_JEXEC') or die;
?>
<?php if(empty($collection) === false) { ?>
<div id="carousel" class="jcarousel-skin-plain">
	<ul>
		<?php foreach($collection as $article) { ?>
			<?php $images = json_decode($article->images); ?>
			<li>
				<?php if(isset($images->image_intro) && !empty($images->image_intro)) { ?>
					<?php
						// Ausrichtung des Bildes
						$imgfloat = $params->get('float_intro');
						if(empty($images->float_intro) === false) {
							$imgfloat = $images->float_intro;
						}
						if(empty($imgfloat) === false) {
							$imgfloat = 'article-intro-image-' . htmlspecialchars($imgfloat);
						}

						// Alttext | Bildtitel
						$imgalt		= htmlspecialchars($images->image_intro_alt);
						$imgtitle = '';
						if($images->image_intro_caption) {
							$imgtitle = 'title="' . htmlspecialchars($images->image_intro_caption) . '"';
						}
					?>

					<div class="article-intro-image <?php echo $imgfloat; ?>">
						<img <?php echo $imgtitle ?> src="<?php echo htmlspecialchars($images->image_intro); ?>" alt="<?php echo $imgalt ?>"/>
					</div>
				<?php } ?>

				<div class="article-outer">
					<h2 class="article-header"><?php echo $article->title; ?></h2>
					<?php echo $article->introtext; ?>
				</div>
			</li>
		<?php } ?>
	</ul>

	<div class="jcarousel-control">
		<ul>
			<?php foreach($collection as $i => $article) { ?>
				<li><a href="#" title="<?php echo ($i + 1); ?>"><span><?php echo ($i + 1); ?></span></a></li>
			<?php } ?>
		</ul>
	</div>
</div>
<?php } ?>